<?php
require_once("groupView.php");
require_once(CORE_DIR.'groupModel.php');

class deleteAction extends authAction{

	function __construct(){
		$this->view = new groupView();
	}

	public function run($get, $post, $viewtype) {
		parent::run($get,$post,$viewtype);
		
		$gModel = new groupModel();			
		
		if (isset($get["id"]) ){
			$id = $get["id"];
			
			$status = 0;
			if ($gModel->deleteGroup($id)){
				$status = 1;
			}	
			$this->view->setProperty("status", $status);
			$this->view->setProperty("id", $id);
			$this->view->showDeleteGroup();
		}
		else{
			$this->view->showBadCmd();
		}	
			
	}
}
?>